(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

isLeaf(leaf) → true
isLeaf(cons(u, v)) → false
left(cons(u, v)) → u
right(cons(u, v)) → v
concat(leaf, y) → y
concat(cons(u, v), y) → cons(u, concat(v, y))
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v)
if1(b, true, u, v) → false
if1(b, false, u, v) → if2(b, u, v)
if2(true, u, v) → true
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v)))

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

isLeaf(leaf) → true [1]
isLeaf(cons(u, v)) → false [1]
left(cons(u, v)) → u [1]
right(cons(u, v)) → v [1]
concat(leaf, y) → y [1]
concat(cons(u, v), y) → cons(u, concat(v, y)) [1]
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v) [1]
if1(b, true, u, v) → false [1]
if1(b, false, u, v) → if2(b, u, v) [1]
if2(true, u, v) → true [1]
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v))) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

isLeaf(leaf) → true [1]
isLeaf(cons(u, v)) → false [1]
left(cons(u, v)) → u [1]
right(cons(u, v)) → v [1]
concat(leaf, y) → y [1]
concat(cons(u, v), y) → cons(u, concat(v, y)) [1]
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v) [1]
if1(b, true, u, v) → false [1]
if1(b, false, u, v) → if2(b, u, v) [1]
if2(true, u, v) → true [1]
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v))) [1]

The TRS has the following type information:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


less_leaves
if1
if2

(c) The following functions are completely defined:

isLeaf
concat
left
right

Due to the following rules being added:

left(v0) → leaf [0]
right(v0) → leaf [0]

And the following fresh constants: none

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

isLeaf(leaf) → true [1]
isLeaf(cons(u, v)) → false [1]
left(cons(u, v)) → u [1]
right(cons(u, v)) → v [1]
concat(leaf, y) → y [1]
concat(cons(u, v), y) → cons(u, concat(v, y)) [1]
less_leaves(u, v) → if1(isLeaf(u), isLeaf(v), u, v) [1]
if1(b, true, u, v) → false [1]
if1(b, false, u, v) → if2(b, u, v) [1]
if2(true, u, v) → true [1]
if2(false, u, v) → less_leaves(concat(left(u), right(u)), concat(left(v), right(v))) [1]
left(v0) → leaf [0]
right(v0) → leaf [0]

The TRS has the following type information:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

isLeaf(leaf) → true [1]
isLeaf(cons(u, v)) → false [1]
left(cons(u, v)) → u [1]
right(cons(u, v)) → v [1]
concat(leaf, y) → y [1]
concat(cons(u, v), y) → cons(u, concat(v, y)) [1]
less_leaves(leaf, leaf) → if1(true, true, leaf, leaf) [3]
less_leaves(leaf, cons(u'', v'')) → if1(true, false, leaf, cons(u'', v'')) [3]
less_leaves(cons(u', v'), leaf) → if1(false, true, cons(u', v'), leaf) [3]
less_leaves(cons(u', v'), cons(u1, v1)) → if1(false, false, cons(u', v'), cons(u1, v1)) [3]
if1(b, true, u, v) → false [1]
if1(b, false, u, v) → if2(b, u, v) [1]
if2(true, u, v) → true [1]
if2(false, cons(u2, v2), cons(u4, v4)) → less_leaves(concat(u2, v2), concat(u4, v4)) [5]
if2(false, cons(u2, v2), cons(u4, v4)) → less_leaves(concat(u2, v2), concat(u4, leaf)) [4]
if2(false, cons(u2, v2), cons(u8, v8)) → less_leaves(concat(u2, v2), concat(leaf, v8)) [4]
if2(false, cons(u2, v2), v) → less_leaves(concat(u2, v2), concat(leaf, leaf)) [3]
if2(false, cons(u2, v2), cons(u5, v5)) → less_leaves(concat(u2, leaf), concat(u5, v5)) [4]
if2(false, cons(u2, v2), cons(u5, v5)) → less_leaves(concat(u2, leaf), concat(u5, leaf)) [3]
if2(false, cons(u2, v2), cons(u9, v9)) → less_leaves(concat(u2, leaf), concat(leaf, v9)) [3]
if2(false, cons(u2, v2), v) → less_leaves(concat(u2, leaf), concat(leaf, leaf)) [2]
if2(false, cons(u3, v3), cons(u6, v6)) → less_leaves(concat(leaf, v3), concat(u6, v6)) [4]
if2(false, cons(u3, v3), cons(u6, v6)) → less_leaves(concat(leaf, v3), concat(u6, leaf)) [3]
if2(false, cons(u3, v3), cons(u10, v10)) → less_leaves(concat(leaf, v3), concat(leaf, v10)) [3]
if2(false, cons(u3, v3), v) → less_leaves(concat(leaf, v3), concat(leaf, leaf)) [2]
if2(false, u, cons(u7, v7)) → less_leaves(concat(leaf, leaf), concat(u7, v7)) [3]
if2(false, u, cons(u7, v7)) → less_leaves(concat(leaf, leaf), concat(u7, leaf)) [2]
if2(false, u, cons(u11, v11)) → less_leaves(concat(leaf, leaf), concat(leaf, v11)) [2]
if2(false, u, v) → less_leaves(concat(leaf, leaf), concat(leaf, leaf)) [1]
left(v0) → leaf [0]
right(v0) → leaf [0]

The TRS has the following type information:
isLeaf :: leaf:cons → true:false
leaf :: leaf:cons
true :: true:false
cons :: leaf:cons → leaf:cons → leaf:cons
false :: true:false
left :: leaf:cons → leaf:cons
right :: leaf:cons → leaf:cons
concat :: leaf:cons → leaf:cons → leaf:cons
less_leaves :: leaf:cons → leaf:cons → true:false
if1 :: true:false → true:false → leaf:cons → leaf:cons → true:false
if2 :: true:false → leaf:cons → leaf:cons → true:false

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

leaf => 0
true => 1
false => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ y :|: y >= 0, z = 0, z' = y
concat(z, z') -{ 1 }→ 1 + u + concat(v, y) :|: z = 1 + u + v, v >= 0, y >= 0, z' = y, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(b, u, v) :|: b >= 0, z1 = v, v >= 0, z = b, z'' = u, z' = 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: b >= 0, z1 = v, v >= 0, z' = 1, z = b, z'' = u, u >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' = v, v >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' = v, v >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: z'' = v, u3 >= 0, v >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, z' = u, v7 >= 0, z = 0, z'' = 1 + u7 + v7, u >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, z' = u, v7 >= 0, z = 0, z'' = 1 + u7 + v7, u >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, z' = u, u11 >= 0, z = 0, z'' = 1 + u11 + v11, u >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' = v, v >= 0, z' = u, z = 0, u >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' = v, v >= 0, z = 1, z' = u, u >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0

(11) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(12) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 1 }→ 1 + u + concat(v, z') :|: z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

(13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ isLeaf }
{ concat }
{ right }
{ left }
{ if2, less_leaves, if1 }

(14) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 1 }→ 1 + u + concat(v, z') :|: z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {isLeaf}, {concat}, {right}, {left}, {if2,less_leaves,if1}

(15) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: isLeaf
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(16) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 1 }→ 1 + u + concat(v, z') :|: z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {isLeaf}, {concat}, {right}, {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: ?, size: O(1) [1]

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: isLeaf
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(18) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 1 }→ 1 + u + concat(v, z') :|: z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {concat}, {right}, {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]

(19) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(20) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 1 }→ 1 + u + concat(v, z') :|: z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {concat}, {right}, {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: concat
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

(22) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 1 }→ 1 + u + concat(v, z') :|: z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {concat}, {right}, {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: ?, size: O(n1) [z + z']

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: concat
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z

(24) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 1 }→ 1 + u + concat(v, z') :|: z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(concat(u2, v2), concat(u4, v4)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(u4, 0)) :|: v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, v2), concat(0, v8)) :|: v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, v2), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(u2, 0), concat(u5, v5)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(u5, 0)) :|: z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(u2, 0), concat(0, v9)) :|: z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(u2, 0), concat(0, 0)) :|: z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(concat(0, v3), concat(u6, v6)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(u6, 0)) :|: u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, v3), concat(0, v10)) :|: u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, v3), concat(0, 0)) :|: u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(concat(0, 0), concat(u7, v7)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(u7, 0)) :|: u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 2 }→ less_leaves(concat(0, 0), concat(0, v11)) :|: v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 1 }→ less_leaves(concat(0, 0), concat(0, 0)) :|: z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {right}, {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']

(25) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(26) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {right}, {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: right
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(28) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {right}, {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: ?, size: O(n1) [z]

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: right
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(30) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: O(1) [1], size: O(n1) [z]

(31) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(32) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: O(1) [1], size: O(n1) [z]

(33) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: left
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(34) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {left}, {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: O(1) [1], size: O(n1) [z]
left: runtime: ?, size: O(n1) [z]

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: left
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(36) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: O(1) [1], size: O(n1) [z]
left: runtime: O(1) [1], size: O(n1) [z]

(37) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(38) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: O(1) [1], size: O(n1) [z]
left: runtime: O(1) [1], size: O(n1) [z]

(39) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: if2
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

Computed SIZE bound using CoFloCo for: less_leaves
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

Computed SIZE bound using CoFloCo for: if1
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(40) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed: {if2,less_leaves,if1}
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: O(1) [1], size: O(n1) [z]
left: runtime: O(1) [1], size: O(n1) [z]
if2: runtime: ?, size: O(1) [1]
less_leaves: runtime: ?, size: O(1) [1]
if1: runtime: ?, size: O(1) [1]

(41) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using KoAT for: if2
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 235 + 238·z' + 16·z'·z'' + 8·z'2 + 238·z'' + 8·z''2

Computed RUNTIME bound using PUBS for: less_leaves
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 239 + 238·z + 16·z·z' + 8·z2 + 238·z' + 8·z'2

Computed RUNTIME bound using PUBS for: if1
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 236 + 238·z'' + 16·z''·z1 + 8·z''2 + 238·z1 + 8·z12

(42) Obligation:

Complexity RNTS consisting of the following rules:

concat(z, z') -{ 1 }→ z' :|: z' >= 0, z = 0
concat(z, z') -{ 2 + v }→ 1 + u + s :|: s >= 0, s <= 1 * v + 1 * z', z = 1 + u + v, v >= 0, z' >= 0, u >= 0
if1(z, z', z'', z1) -{ 1 }→ if2(z, z'', z1) :|: z >= 0, z1 >= 0, z' = 0, z'' >= 0
if1(z, z', z'', z1) -{ 1 }→ 0 :|: z >= 0, z1 >= 0, z' = 1, z'' >= 0
if2(z, z', z'') -{ 7 + u2 + u4 }→ less_leaves(s', s'') :|: s' >= 0, s' <= 1 * u2 + 1 * v2, s'' >= 0, s'' <= 1 * u4 + 1 * v4, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u4 }→ less_leaves(s1, s2) :|: s1 >= 0, s1 <= 1 * u2 + 1 * v2, s2 >= 0, s2 <= 1 * u4 + 1 * 0, v4 >= 0, z' = 1 + u2 + v2, z'' = 1 + u4 + v4, u2 >= 0, u4 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s11, s12) :|: s11 >= 0, s11 <= 1 * u2 + 1 * 0, s12 >= 0, s12 <= 1 * 0 + 1 * v9, z' = 1 + u2 + v2, z'' = 1 + u9 + v9, u9 >= 0, v9 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 4 + u2 }→ less_leaves(s13, s14) :|: s13 >= 0, s13 <= 1 * u2 + 1 * 0, s14 >= 0, s14 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u6 }→ less_leaves(s15, s16) :|: s15 >= 0, s15 <= 1 * 0 + 1 * v3, s16 >= 0, s16 <= 1 * u6 + 1 * v6, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u6 }→ less_leaves(s17, s18) :|: s17 >= 0, s17 <= 1 * 0 + 1 * v3, s18 >= 0, s18 <= 1 * u6 + 1 * 0, u3 >= 0, z' = 1 + u3 + v3, u6 >= 0, v6 >= 0, z'' = 1 + u6 + v6, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 }→ less_leaves(s19, s20) :|: s19 >= 0, s19 <= 1 * 0 + 1 * v3, s20 >= 0, s20 <= 1 * 0 + 1 * v10, u3 >= 0, z' = 1 + u3 + v3, z'' = 1 + u10 + v10, u10 >= 0, v10 >= 0, z = 0, v3 >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s21, s22) :|: s21 >= 0, s21 <= 1 * 0 + 1 * v3, s22 >= 0, s22 <= 1 * 0 + 1 * 0, u3 >= 0, z'' >= 0, z' = 1 + u3 + v3, z = 0, v3 >= 0
if2(z, z', z'') -{ 5 + u7 }→ less_leaves(s23, s24) :|: s23 >= 0, s23 <= 1 * 0 + 1 * 0, s24 >= 0, s24 <= 1 * u7 + 1 * v7, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 + u7 }→ less_leaves(s25, s26) :|: s25 >= 0, s25 <= 1 * 0 + 1 * 0, s26 >= 0, s26 <= 1 * u7 + 1 * 0, u7 >= 0, v7 >= 0, z = 0, z'' = 1 + u7 + v7, z' >= 0
if2(z, z', z'') -{ 4 }→ less_leaves(s27, s28) :|: s27 >= 0, s27 <= 1 * 0 + 1 * 0, s28 >= 0, s28 <= 1 * 0 + 1 * v11, v11 >= 0, u11 >= 0, z = 0, z'' = 1 + u11 + v11, z' >= 0
if2(z, z', z'') -{ 3 }→ less_leaves(s29, s30) :|: s29 >= 0, s29 <= 1 * 0 + 1 * 0, s30 >= 0, s30 <= 1 * 0 + 1 * 0, z'' >= 0, z = 0, z' >= 0
if2(z, z', z'') -{ 6 + u2 }→ less_leaves(s3, s4) :|: s3 >= 0, s3 <= 1 * u2 + 1 * v2, s4 >= 0, s4 <= 1 * 0 + 1 * v8, v8 >= 0, u8 >= 0, z' = 1 + u2 + v2, z'' = 1 + u8 + v8, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 }→ less_leaves(s5, s6) :|: s5 >= 0, s5 <= 1 * u2 + 1 * v2, s6 >= 0, s6 <= 1 * 0 + 1 * 0, z'' >= 0, z' = 1 + u2 + v2, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 6 + u2 + u5 }→ less_leaves(s7, s8) :|: s7 >= 0, s7 <= 1 * u2 + 1 * 0, s8 >= 0, s8 <= 1 * u5 + 1 * v5, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 5 + u2 + u5 }→ less_leaves(s9, s10) :|: s9 >= 0, s9 <= 1 * u2 + 1 * 0, s10 >= 0, s10 <= 1 * u5 + 1 * 0, z' = 1 + u2 + v2, z'' = 1 + u5 + v5, u5 >= 0, v5 >= 0, u2 >= 0, z = 0, v2 >= 0
if2(z, z', z'') -{ 1 }→ 1 :|: z'' >= 0, z = 1, z' >= 0
isLeaf(z) -{ 1 }→ 1 :|: z = 0
isLeaf(z) -{ 1 }→ 0 :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 1 }→ u :|: z = 1 + u + v, v >= 0, u >= 0
left(z) -{ 0 }→ 0 :|: z >= 0
less_leaves(z, z') -{ 3 }→ if1(1, 1, 0, 0) :|: z = 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(1, 0, 0, 1 + u'' + v'') :|: u'' >= 0, v'' >= 0, z' = 1 + u'' + v'', z = 0
less_leaves(z, z') -{ 3 }→ if1(0, 1, 1 + u' + v', 0) :|: z = 1 + u' + v', u' >= 0, v' >= 0, z' = 0
less_leaves(z, z') -{ 3 }→ if1(0, 0, 1 + u' + v', 1 + u1 + v1) :|: z = 1 + u' + v', z' = 1 + u1 + v1, u' >= 0, v' >= 0, u1 >= 0, v1 >= 0
right(z) -{ 1 }→ v :|: z = 1 + u + v, v >= 0, u >= 0
right(z) -{ 0 }→ 0 :|: z >= 0

Function symbols to be analyzed:
Previous analysis results are:
isLeaf: runtime: O(1) [1], size: O(1) [1]
concat: runtime: O(n1) [1 + z], size: O(n1) [z + z']
right: runtime: O(1) [1], size: O(n1) [z]
left: runtime: O(1) [1], size: O(n1) [z]
if2: runtime: O(n2) [235 + 238·z' + 16·z'·z'' + 8·z'2 + 238·z'' + 8·z''2], size: O(1) [1]
less_leaves: runtime: O(n2) [239 + 238·z + 16·z·z' + 8·z2 + 238·z' + 8·z'2], size: O(1) [1]
if1: runtime: O(n2) [236 + 238·z'' + 16·z''·z1 + 8·z''2 + 238·z1 + 8·z12], size: O(1) [1]

(43) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(44) BOUNDS(1, n^2)